import { http } from '../plugs/aixos'

export function findAllLog(args = {}) {
  const url = `log/?` + Object.entries(args).map(([key, value]) => `${key}=${value}`)
  return http.request<logModel[]>({
    url,
    method: 'GET',
  })
}

export function addLog(data: logModel) {
  return http.request<logModel>({
    url: 'log',
    method: 'POST',
    data,
  })
}

export function delLog(id: number) {
  return http.request<logModel>({
    url: `log/${id}`,
    method: 'DELETE',
  })
}

export function findLog(id: number) {
  return http.request<logModel>({
    url: `log/${id}`,
    method: 'GET',
  })
}

// export function updateBook(id: number, data: any) {
//   return http.request<BookModel>({
//     url: `book/${id}`,
//     method: "PATCH",
//     data,
//   });
// }
